limmaReport<- function(testResults, fit, fit2, M, symbolList, nameList, projectName="project", reducedList=FALSE){
    resTable <- matrix(0, dim(M)[1], dim(testResults)[2]*2)
    rownames(resTable) <- rownames(M)
 
    resTable[ ,(1:dim(testResults)[2])*2 - 1] <- fit2$coefficients
    colnames(resTable) <- as.character(1:(dim(testResults)[2]*2))
    colnames(resTable)[(1:dim(testResults)[2])*2-1] <- paste(colnames(testResults), "M", sep = "_")
    colnames(resTable)[(1:dim(testResults)[2])*2] <- paste(colnames(testResults), "p", sep = "_")
    
    for (cont in (1:dim(testResults)[2])*2){
        resTable[,cont]<- p.adjust(fit2$p.value[,cont/2], method="fdr")
    }
    A <- rowMeans(M)
    ToFile <- list(GeneSymbol=unlist(symbolList)[rownames(M)],
                   GeneName=unlist(nameList)[rownames(M)],
                   M=resTable,
                   sig=testResults[, 1:dim(testResults)[2]],
                   E=fit$coefficients,
                   A=A)
    ToFile <- as.data.frame(ToFile)
    
    colnames(ToFile)[3:(dim(testResults)[2]*2 + 2)] <- colnames(resTable)
    if (reducedList == TRUE){
      keep <- rowSums(abs(testResults)) != 0 
      ToFile <- ToFile[keep,]
    }
    write.table(ToFile, file=paste(projectName, "AllResults.txt"), sep="\t")
    return(ToFile)
}


